<script setup lang="ts">
  import { getCodeApi } from '@/apis/user'
  import { request } from '@/utils/request'
  import { useCounterStore } from '@/stores/counter'
  const store = useCounterStore()
  // 请求测试
  const login = async () => {
    const res = await request.post('/login/password', {
      mobile: '13211112222',
      // 密码 abc123456 测试：出现非 10000 的情况
      password: 'abc12345',
    })
    console.log(res)
  }
  const getMobileCode = async () => {
    const res = await getCodeApi({ mobile: '13230000055', type: 'login' })
    console.log(res.code)
  }
</script>
<template>
  <view class="content">
    <button @click="login">测试登录</button>
    <button @click="getMobileCode">获取验证码</button>
    <button type="primary">按钮1</button>
    <button type="warn">按钮2</button>
    <button @click="store.increment">{{ store.count }} +</button>
    <button @click="store.decrement">{{ store.double }} -</button>
  </view>
</template>
